import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 分部的 路由  在这里 全局引入
import errorRoute from "@/views/errorpage/route.js"
import mainRoute from "@/views/main/route.js"
import goodsRoute from "@/views/goods/route.js"
import signinsRoute from "@/views/signins/route.js"

const routes = [{
    path: '/',
    redirect: {
      name: "guide"
    }
  },
  {
    path: "/guide",
    name: "guide",
    component: () => import("@/views/guide/guide.vue")
  },
  ...errorRoute,
  ...mainRoute,
  ...goodsRoute,
  ...signinsRoute,
  {
    path: "*",
    redirect: {
      name: "404"
    }
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
